package com.atguigu.java1;

public class ValueTransferTest1 {
		public static void main(String[] args) {
			int m = 10;
			int n = 20;
			
			System.out.println("m =" + m + ", n =" + n);
				//交换两变量的值,错误方法
//			int temp = m;
//			m = n;
//			n = temp;
			ValueTransferTest1 test = new ValueTransferTest1();
			test.swap(m, n);
			
				
		}
		
		public void swap(int m, int n){
			int temp = m;
			m = n;
			n = temp;

		}
}


